-- 设置快捷键

-- 设置快捷键首先要设置 leader 键和 localleader键
vim.g.mapleader = ","
vim.g.maplocalleader = ","
-- 取消高亮
vim.keymap.set("n", "<leader><space>", "<cmd>nohlsearch<cr>", { silent = true  })

----nnoremap <silent> gb :BufferLinePick<CR>
vim.api.nvim_set_keymap("n", "gb", "<Cmd>BufferLinePick<CR>", {noremap = true, silent = true})

-- bufferline 按键映射
vim.keymap.set("n", "<C-p>", "<cmd>BufferLineCyclePrev<cr>", { silent = true  })
vim.keymap.set("n", "<C-n>", "<cmd>BufferLineCycleNext<cr>", { silent = true  })

-- 打开、关闭 NvimTreeToggle
vim.keymap.set("n", "<leader>tt", "<cmd>NvimTreeToggle<cr>", { silent = true  })

-- telescope 全局查找
vim.keymap.set("n", "<leader>ff", "<cmd>Telescope find_files<cr>", {silent = true})
vim.keymap.set("n", "<leader>fg", "<cmd>Telescope live_grep<cr>", {silent = true})
vim.keymap.set("n", "<leader>fb", "<cmd>Telescope buffers<cr>", {silent = true})
vim.keymap.set("n", "<leader>fh", "<cmd>Telescope help_tags<cr>", {silent = true})

